package com.example.ruoyivoicecall.common;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 系统配置工具类
 */
@Component
public class SysConfigUtil {
    
    // 语音单元相关配置
    private static String voiceUnitUrl;
    private static String voiceUnitUserName;
    private static String voiceUnitPassword;
    private static String serverPath;
    private static String fileUploadFolderName;
    private static String localVoiceSavePath;
    private static String serverFileDirName;
    
    @Value("${voice.unit.url:http://192.168.100.12:7627}")
    public void setVoiceUnitUrl(String url) {
        voiceUnitUrl = url;
    }
    
    @Value("${voice.unit.username:1000}")
    public void setVoiceUnitUserName(String username) {
        voiceUnitUserName = username;
    }
    
    @Value("${voice.unit.password:1}")
    public void setVoiceUnitPassword(String password) {
        voiceUnitPassword = password;
    }
    
    @Value("${voice.server.path:http://localhost:8080}")
    public void setServerPath(String path) {
        serverPath = path;
    }
    
    @Value("${voice.file.upload.folder:upload}")
    public void setFileUploadFolderName(String folderName) {
        fileUploadFolderName = folderName;
    }
    
    @Value("${voice.local.save.path:./voice}")
    public void setLocalVoiceSavePath(String path) {
        localVoiceSavePath = path;
    }
    
    @Value("${voice.server.file.dir:files}")
    public void setServerFileDirName(String dirName) {
        serverFileDirName = dirName;
    }
    
    // getter方法
    public static String getVoiceUnitUrl() {
        return voiceUnitUrl;
    }
    
    public static String getVoiceUnitUserName() {
        return voiceUnitUserName;
    }
    
    public static String getVoiceUnitPassword() {
        return voiceUnitPassword;
    }
    
    public static String getServerPath() {
        return serverPath;
    }
    
    public static String getFileUploadFolderName() {
        return fileUploadFolderName;
    }
    
    public static String getLocalVoiceSavePath() {
        return localVoiceSavePath;
    }
    
    public static String getServerFileDirName() {
        return serverFileDirName;
    }
}